------------------------------------------------------------------------------------------------------------------
      name:  <unnamed>
       log:  C:\Users\sgolder\Dropbox\Portfolio Allocation\replication\ariottigolder-descriptive1.log
  log type:  text
 opened on:  30 Mar 2017, 14:08:02

. set more off

. #delimit ;
delimiter now ;
. *     ***************************************************************** *;
. *     ***************************************************************** *;
. *       File-Name:      ariotti_golder-descriptive1.do                  *;
. *       Date:           September 9, 2016                               *;
. *       Author:         Molly Ariotti and Sona Golder                   *;
. *       Purpose:        Get some descriptive data.                      *;
. *           Input File:     Africa_govt_obs.dta                             *;
. *       Output File:    ariottigolder-descriptive1.log                  *;
. *       Data Output:    Africa_govt_descriptive.dta                     *;
.              *       Previous file:  Africa_govt_obs.xls --> Stata .dta              *;
. *       Machine:        laptop                                                          *;
. *     ****************************************************************  *;
. *     ****************************************************************  *;
. *     ****************************************************************  *;
. *       Open and summarize dataset. Generate some variables.            *;
. *     ****************************************************************  *;
. use "C:\Users\sgolder\Dropbox\Portfolio Allocation\replication\Africa_govt_obs.dta";

. *     ****************************************************************  *;
. *       Label variables                                                 *;
. *     ****************************************************************  *;
. label var name "country name";

. label var democraticyears "years country is democratic during 1990-2014";

. label var cabinet "cabinet code";

. label var cabinetdates "date in and date out of cabinet";

. label var legislativeelection "date of previous legislative election";

. label var presidentialelection "date of previous presidential election";

. label var postelection "1 if govt forms following election, 0 otherwise";

. label var govtcoalition "1 if govt is coalition, 0 otherwise";

. label var cangetdata "1 = can get complete partisan portfolio information (if coalition), 0 = otherwise";
note: label truncated to 80 characters

. label var regimetype "0=parl, 1= semi-pres, 2=pres";

.  label var govt_size "number of portfolios in the government";

. sum;

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
        name |          0
democratic~s |          0
     cabinet |        162    5.135802    3.707481          1         19
cabinetdates |          0
legislativ~n |          0
-------------+---------------------------------------------------------
presidenti~n |          0
postelection |        162    .6481481    .4790288          0          1
govtcoalit~n |        162    .4506173    .4990982          0          1
  cangetdata |        162    .1728395    .3792809          0          1
  regimetype |        162    1.185185    .7068627          0          2
-------------+---------------------------------------------------------
   govt_size |         68    21.30882     5.80853          9         37

. desc;

Contains data from C:\Users\sgolder\Dropbox\Portfolio Allocation\replication\Africa_govt_obs.dta
  obs:           162                          
 vars:            11                          30 Mar 2017 11:48
 size:        20,250                          
------------------------------------------------------------------------------------------------------------------
              storage   display    value
variable name   type    format     label      variable label
------------------------------------------------------------------------------------------------------------------
name            str44   %44s                  country name
democraticyears str24   %24s                  years country is democratic during 1990-2014
cabinet         byte    %8.0g                 cabinet code
cabinetdates    str31   %31s                  date in and date out of cabinet
legislativeel~n str10   %10s                  date of previous legislative election
presidentiale~n str10   %10s                  date of previous presidential election
postelection    byte    %8.0g                 1 if govt forms following election, 0 otherwise
govtcoalition   byte    %8.0g                 1 if govt is coalition, 0 otherwise
cangetdata      byte    %8.0g                 1 = can get complete partisan portfolio information (if coalition),
                                                0 = otherwis
regimetype      byte    %8.0g                 0=parl, 1= semi-pres, 2=pres
govt_size       byte    %8.0g                 number of portfolios in the government
------------------------------------------------------------------------------------------------------------------
Sorted by: 

. *     ****************************************************************  *;
. *       Identify countries with coalitions, data                        *;
. *     ****************************************************************  *;
. list name if govtcoalition==1;

     +----------------------------------------------+
     |                                         name |
     |----------------------------------------------|
  3. |                            Republic of Benin |
  4. |                            Republic of Benin |
  5. |                            Republic of Benin |
  6. |                            Republic of Benin |
  7. |                            Republic of Benin |
     |----------------------------------------------|
  8. |                            Republic of Benin |
  9. |                            Republic of Benin |
 12. |                            Republic of Benin |
 21. |                          Republic of Burundi |
 22. |                          Republic of Burundi |
     |----------------------------------------------|
 23. |                          Republic of Burundi |
 24. |                          Republic of Burundi |
 25. |                          Republic of Burundi |
 32. |                         Union of the Comoros |
 40. |                            Republic of Ghana |
     |----------------------------------------------|
 44. |                    Republic of Guinea-Bissau |
 45. |                    Republic of Guinea-Bissau |
 46. |                    Republic of Guinea-Bissau |
 48. |                    Republic of Guinea-Bissau |
 49. |                            Republic of Kenya |
     |----------------------------------------------|
 50. |                            Republic of Kenya |
 51. |                            Republic of Kenya |
 52. |                            Republic of Kenya |
 53. |                            Republic of Kenya |
 54. |                            Republic of Kenya |
     |----------------------------------------------|
 57. |                           Kingdom of Lesotho |
 58. |                          Republic of Liberia |
 64. |                       Republic of Madagascar |
 72. |                           Republic of Malawi |
 75. |                           Republic of Malawi |
     |----------------------------------------------|
 76. |                           Republic of Malawi |
 79. |                           Republic of Malawi |
 80. |                           Republic of Malawi |
 81. |                             Republic of Mali |
 82. |                             Republic of Mali |
     |----------------------------------------------|
 83. |                             Republic of Mali |
 84. |                             Republic of Mali |
 85. |                             Republic of Mali |
 87. |                             Republic of Mali |
 88. |                             Republic of Mali |
     |----------------------------------------------|
 91. |                             Republic of Mali |
 92. |                        Republic of Mauritius |
 93. |                        Republic of Mauritius |
 94. |                        Republic of Mauritius |
 95. |                        Republic of Mauritius |
     |----------------------------------------------|
 97. |                        Republic of Mauritius |
 98. |                        Republic of Mauritius |
 99. |                        Republic of Mauritius |
100. |                        Republic of Mauritius |
101. |                        Republic of Mauritius |
     |----------------------------------------------|
107. |                            Republic of Niger |
108. |                            Republic of Niger |
109. |                            Republic of Niger |
111. |                            Republic of Niger |
112. |                            Republic of Niger |
     |----------------------------------------------|
113. |                            Republic of Niger |
116. | Democratic Republic of Sao Tome and Principe |
117. | Democratic Republic of Sao Tome and Principe |
118. | Democratic Republic of Sao Tome and Principe |
121. | Democratic Republic of Sao Tome and Principe |
     |----------------------------------------------|
122. | Democratic Republic of Sao Tome and Principe |
123. | Democratic Republic of Sao Tome and Principe |
124. | Democratic Republic of Sao Tome and Principe |
125. | Democratic Republic of Sao Tome and Principe |
127. | Democratic Republic of Sao Tome and Principe |
     |----------------------------------------------|
128. | Democratic Republic of Sao Tome and Principe |
129. | Democratic Republic of Sao Tome and Principe |
131. | Democratic Republic of Sao Tome and Principe |
152. |                     Republic of Sierra Leone |
154. |                     Republic of South Africa |
     |----------------------------------------------|
155. |                     Republic of South Africa |
156. |                     Republic of South Africa |
157. |                     Republic of South Africa |
     +----------------------------------------------+

. list name if cangetdata==1;

     +----------------------------------------------+
     |                                         name |
     |----------------------------------------------|
 21. |                          Republic of Burundi |
 24. |                          Republic of Burundi |
 25. |                          Republic of Burundi |
 40. |                            Republic of Ghana |
 44. |                    Republic of Guinea-Bissau |
     |----------------------------------------------|
 45. |                    Republic of Guinea-Bissau |
 49. |                            Republic of Kenya |
 50. |                            Republic of Kenya |
 52. |                            Republic of Kenya |
 53. |                            Republic of Kenya |
     |----------------------------------------------|
 57. |                           Kingdom of Lesotho |
 72. |                           Republic of Malawi |
 75. |                           Republic of Malawi |
 80. |                           Republic of Malawi |
 92. |                        Republic of Mauritius |
     |----------------------------------------------|
 93. |                        Republic of Mauritius |
 94. |                        Republic of Mauritius |
 95. |                        Republic of Mauritius |
100. |                        Republic of Mauritius |
101. |                        Republic of Mauritius |
     |----------------------------------------------|
117. | Democratic Republic of Sao Tome and Principe |
118. | Democratic Republic of Sao Tome and Principe |
121. | Democratic Republic of Sao Tome and Principe |
122. | Democratic Republic of Sao Tome and Principe |
154. |                     Republic of South Africa |
     |----------------------------------------------|
155. |                     Republic of South Africa |
156. |                     Republic of South Africa |
157. |                     Republic of South Africa |
     +----------------------------------------------+

. *     ****************************************************************  *;
. *      Get total number of governments that are coalitions, total       *;
. *       number of governments that formed after an election, total      *;
. *       number of governments that are single party, and total number   *;
. *       of coalition governments for which we have full partisan        *;
. *       portfolio allocation data                                       *;
. *     ****************************************************************  *;
. sum govtcoalition if govtcoalition==1;

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
govtcoalit~n |         73           1           0          1          1

. sum govtcoalition if govtcoalition==0;

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
govtcoalit~n |         89           0           0          0          0

. sum govtcoalition if postelection==0;

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
govtcoalit~n |         57    .5964912    .4949621          0          1

. sum govtcoalition if postelection==1;

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
govtcoalit~n |        105    .3714286    .4855042          0          1

. sum govtcoalition if postelection==0 & govtcoalition==1;

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
govtcoalit~n |         34           1           0          1          1

. sum govtcoalition if postelection==1 & govtcoalition==1;

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
govtcoalit~n |         39           1           0          1          1

. sum govtcoalition if govtcoalition==1 & cangetdata==1;

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
govtcoalit~n |         28           1           0          1          1

. sum govtcoalition if govtcoalition==1 & cangetdata==0;

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
govtcoalit~n |         45           1           0          1          1

. *     ****************************************************************  *;
. *       Identify numbers of parl (regimetype 0 or 1) and pres govts,    *;
. *       (regimetype 2) and by govt type (coalition or single party)     *;
. *     ****************************************************************  *;
. sum govtcoalition if regimetype==0;

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
govtcoalit~n |         28          .5    .5091751          0          1

. sum govtcoalition if regimetype==1;

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
govtcoalit~n |         76    .4078947    .4947088          0          1

. sum govtcoalition if regimetype==2;

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
govtcoalit~n |         58    .4827586    .5040669          0          1

. sum govtcoalition if govtcoalition==1 & regimetype==0;

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
govtcoalit~n |         14           1           0          1          1

. sum govtcoalition if govtcoalition==1 & regimetype==1;

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
govtcoalit~n |         31           1           0          1          1

. sum govtcoalition if govtcoalition==1 & regimetype==2;

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
govtcoalit~n |         28           1           0          1          1

. sum govtcoalition if govtcoalition==0 & regimetype==0;

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
govtcoalit~n |         14           0           0          0          0

. sum govtcoalition if govtcoalition==0 & regimetype==1;

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
govtcoalit~n |         45           0           0          0          0

. sum govtcoalition if govtcoalition==0 & regimetype==2;

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
govtcoalit~n |         30           0           0          0          0

. *     ****************************************************************  *;
. *       Get descriptive statistics about govt size                      *;
. *       Check that govt_size variable only relevant for coalitions      *;
. *       (missing data otherwise, b/c we didn't check govt sizes for     *;
. *       single-party govts                                              *;
. *     ****************************************************************  *;
. sum govt_size;

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
   govt_size |         68    21.30882     5.80853          9         37

. sum govt_size if govtcoalition==1;

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
   govt_size |         68    21.30882     5.80853          9         37

. sum govt_size if cangetdata==1;

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
   govt_size |         28    22.28571    6.109235         10         37

. sum govt_size if cangetdata==0;

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
   govt_size |         40      20.625    5.564021          9         32

. ttest govt_size, by(cangetdata);

Two-sample t test with equal variances
------------------------------------------------------------------------------
   Group |     Obs        Mean    Std. Err.   Std. Dev.   [95% Conf. Interval]
---------+--------------------------------------------------------------------
       0 |      40      20.625     .879749    5.564021    18.84554    22.40446
       1 |      28    22.28571    1.154537    6.109235     19.9168    24.65463
---------+--------------------------------------------------------------------
combined |      68    21.30882    .7043878     5.80853    19.90286    22.71479
---------+--------------------------------------------------------------------
    diff |           -1.660714    1.427477               -4.510764    1.189335
------------------------------------------------------------------------------
    diff = mean(0) - mean(1)                                      t =  -1.1634
Ho: diff = 0                                     degrees of freedom =       66

    Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0
 Pr(T < t) = 0.1244         Pr(|T| > |t|) = 0.2489          Pr(T > t) = 0.8756

. save "C:\Users\sgolder\Dropbox\Portfolio Allocation\replication\Africa_govt_descriptive.dta", replace;
file C:\Users\sgolder\Dropbox\Portfolio Allocation\replication\Africa_govt_descriptive.dta saved

. log close;
      name:  <unnamed>
       log:  C:\Users\sgolder\Dropbox\Portfolio Allocation\replication\ariottigolder-descriptive1.log
  log type:  text
 closed on:  30 Mar 2017, 14:08:02
------------------------------------------------------------------------------------------------------------------
